package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo{
    public static void main(String[] args) throws IOException {
        int age = 18;
        String name = "张三";
        String gender = "男";
        String[] otherInfo = {"眼睛小", "黑", "嗓门大", "嘀嘀嘀"};
        Person person = new Person(name, age, gender, otherInfo);
        System.out.println(person);
        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(person);
        oos.close();
        System.out.println("写入完毕");
    }
}
